package com.sm.healthy.ui.act

import android.os.Bundle
import androidx.navigation.fragment.findNavController
import com.sm.healthy.R
import com.sm.healthy.base.BaseNoBindActivity
import com.sm.healthy.model.MainViewModel
import com.sm.healthy.utils.SerialPortUtil
import kotlinx.android.synthetic.main.activity_main.*

class MainAct : BaseNoBindActivity<MainViewModel>() {
    override fun layoutId(): Int = R.layout.activity_main

    override fun initView(savedInstanceState: Bundle?) {
        SerialPortUtil.openSrialPort()
        host_fragment.findNavController().apply {
            setGraph(
                R.navigation.navigation
            )
        }
    }

    override fun onDestroy() {
        SerialPortUtil.closeSerialPort()
        super.onDestroy()
    }
}